import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/login/Login.vue'
import Index from '../views/layout/Index'
import Welcome from '../views/layout/Welcome'
import Home from '../views/home/Home'
import User from '../views/user/User'
import Front from '../views/front/Index.vue'
import Homer from '../views/front/Homer'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Front,
    name: 'Front',
  },
  {
    path: '/homer',
    component: Homer,
    name: 'homer',
  },
  {
    path: '/login',
    component: Login,
    name: 'Login'
  },
  {
    path: '/manage',
    component: Index,
    name: 'intool',
    children: [
      {
        path: 'welcome',
        component: Welcome,
        name: 'Welcome',
      },
      {
        path: 'home',
        component: Home,
        name: 'home',
      },
      {
        path: 'user',
        component: User,
        name: 'user',
      }

      // 在上面添加路由
    ]
  }
]

const router = new VueRouter({
  routes
})

router.beforeEach((to,from,next)=>{
  next()

})

export default router
